package tictactoe;

import tictactoe.clientprocessors.ClientProcessor;
import tictactoe.clientprocessors.MultiClientProcessor;
import tictactoe.clientprocessors.SingleClientProcessor;
import tictactoe.gameprocessors.GameProcessor;
import tictactoe.gameprocessors.MultiGameProcessor;
import tictactoe.gameprocessors.SingleGameProcessor;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Created by IntelliJ IDEA.
 * User: Double
 * Date: 15.01.12
 * Time: 21:13
 * To change this template use File | Settings | File Templates.
 */
public class Server
{
	private static ClientProcessor clientProcessor;
	private static GameProcessor gameProcessor;

	public static ClientProcessor getClientProcessor()
	{
		return clientProcessor;
	}
	public static GameProcessor getGameProcessor()
	{
		return gameProcessor;
	}
	public static void main(String[] args)
	{
		new Thread(ConnectionServer.getInstance()).start();
		/*1*/
		SingleClientProcessor singleClientProcessor = new SingleClientProcessor();
		MultiClientProcessor multiClientProcessor = new MultiClientProcessor();
		SingleGameProcessor singleGameProcessor = new SingleGameProcessor();
		MultiGameProcessor multiGameProcessor = new MultiGameProcessor();
		
		
		/*Текущий вид инициализации*/
		clientProcessor = singleClientProcessor;
		gameProcessor = singleGameProcessor;


		Logger.getLogger("TicTacToeServer").log(Level.SEVERE,"Server.class initialized with "+clientProcessor.getClass()+" and "+gameProcessor.getClass());
		//new Thread(multiClientProcessor).start();
		new Thread(singleGameProcessor).start();
		new Thread(singleClientProcessor).start();
		//new Thread(multiGameProcessor).start();
	}
}
